package com.winter.main.service.system.impl;

import com.winter.main.mapper.master.system.SysRuleMapper;
import com.winter.main.model.dto.NavigationDto;
import com.winter.main.model.entity.SysRule;
import com.winter.main.model.entity.SysUser;
import com.winter.main.service.system.SysRuleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Desc:
 * Author: dushuang
 * Date: Create in 2018/4/18
 */
@Service
public class SysRuleServiceImpl implements SysRuleService{

    @Autowired
    private SysRuleMapper ruleMapper;

    @Override
    public List<SysRule> selectRuleByUser(SysUser user) throws Exception {
        return ruleMapper.selectRuleByUser(user);
    }

    @Override
    public List<NavigationDto> selectRootRule(SysUser user) {
        return ruleMapper.selectRootRule(user);
    }

    @Override
    public List<NavigationDto> selectChildRuleWithoutRoot(SysUser user) {
        return ruleMapper.selectChildRuleWithoutRoot(user);
    }
}
